$( document ).ready( function () {
			$( "#signupForm" ).validate( {
				rules: {
					old_password: {
						required: true,
						minlength: 6,
						maxlength: 16
					},
					new_password: {
						required: true,
						minlength: 6,
						maxlength: 16
					},
					confirm_password: {
						required: true,
						minlength: 6,
						maxlength: 16,
						equalTo: "#new_password"
					},					
					agree: "required"
				},
				messages: {
					old_password: {
						required: "请输入密码！",
						minlength: "密码应为6~16位",
						maxlength: "密码应为6~16位"
					},
					new_password: {
						required: "请输入密码！",
						minlength: "密码应为6~16位",
						maxlength: "密码应为6~16位"
					},
					confirm_password: {
						required: "请输入密码！",
						minlength: "密码应为6~16位",
						maxlength: "密码应为6~16位",
						equalTo: "请输入相同的密码"
					},					
					agree: "Please accept our policy"
				},
				errorElement: "em",
				errorPlacement: function ( error, element ) {
					// Add the `help-block` class to the error element
					error.addClass( "help-block" );
					if ( element.prop( "type" ) === "checkbox" ) {
						error.insertAfter( element.parent( "label" ) );
					} else {
						error.insertAfter( element );
					}
				},
				highlight: function ( element, errorClass, validClass ) {
					$( element ).parents( ".col-md-9" ).addClass( "has-error" ).removeClass( "has-success" );
				},
				unhighlight: function (element, errorClass, validClass) {
					$( element ).parents( ".col-md-9" ).addClass( "has-success" ).removeClass( "has-error" );
				}
			} );
			$("#signupForm").validate({

				   onkeyup:false

				});
		} );